﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Power_Default" EnableViewState="false" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../js/jquery.query.url.js" type="text/javascript"></script>
<script>
    $(document).ready(function () {
        $("#btnSelect").click(function () {
            var id = $("#txtId").val()
            id = encodeURI(id); 
            var name = $("#txtName").val();
            name = encodeURI(name);
            var url = "Default.aspx?";
            var con = "";
            if (id != "") {
                if (con != "") {
                    con += "&id=" + id;
                }
                else {
                    con = "id=" + id;
                }
            }
            if (name != "") {
                if (con != "") {
                    con += "&name=" + name;
                }
                else {
                    con = "name=" + name;
                }
            } 
            document.location = url + con;
        })
    })
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="button_bar">
        <asp:Button ID="btnAdd" CssClass="common_button" runat="server" Text="添加" OnClientClick="document.location='add.aspx';return false;" />
       <input type="button" id="btnSelect" value="查询" class="common_button" />
         
    </div>
    <table class="query_form_table">
        <tr>
            <th>
                权限Id
            </th>
            <td>
                <input type="text" id="txtId" />
            </td>
            <th>
                权限名称
            </th>
            <td>
                <input type="text" id="txtName" />
            </td>
          
        </tr>
    </table>
    <table class="data_list_table">
        <tr>
            <th>
                权限Id
            </th>
            <th>
                权限名称
            </th>
            <th>
                链接地址
            </th>
            <th>
                Pid
            </th>
            <th>
                是否禁用
            </th>
            <th>
                操作
            </th>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server" 
            onitemdatabound="Repeater1_ItemDataBound">
            <ItemTemplate>
                <tr>
                    <td class="list_data_number" align="center">
                        <%# Eval("id") %>
                    </td>
                    <td class="list_data_text">
                        <%# Eval("name") %>
                    </td>
                    <td class="list_data_text">
                        <%# Eval("Url")%>
                    </td>
                    <td class="list_data_text">
                        <asp:Label ID="lblPid" runat="server" Text='<%# Eval("Pid") %>'></asp:Label>
                    </td>
                    <td class="list_data_ltext">
                        <asp:Label ID="lblIsEnable" runat="server" Text='<%# Eval("isEnable") %>'></asp:Label>
                    </td>
                    <td class="list_data_ltext">
                        <a href='edit.aspx?id=<%# Eval("id") %>&page=<%=GetPage() %>'>
                            <img src="../images/bt_edit.gif" alt="修改" title="修改" /></a> <a href='delete.aspx?id=<%# Eval("id") %>&page=<%=GetPage() %>' onclick="return confirm('确定删除？')">
                                <img src="../images/bt_del.gif" alt="删除" />
                            </a>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr>
            <th colspan="6" class="pager">
                <div class="pager">
                    <webdiyer:AspNetPager ID="AspNetPager1" runat="server"
                        PageSize="10" onpagechanged="AspNetPager1_PageChanged" 
                        onpagechanging="AspNetPager1_PageChanging">
                    </webdiyer:AspNetPager>
                </div>
            </th>
        </tr>
    </table>
    </form>
</body>
</html>
